txt = "banana,,,,,ssqqqww....."

x = txt.rstrip(",.qsw")

print(x)
